import request from '@/utils/request'

//所有调用后端api的接口地址都写在这
// 用户登录
export function login(username, password) {
  const data = {
    username,
    password
  }
  return request({
    url: '/login',
    method: 'post',
    data: data
  })
}

export function register(username, password) {
  return request({
    url: '/register',
    method: 'post',
    data: {
      username,
      password
    }
  })
}

// 获取用户信息
export function getInfo() {
  return request({
    url: '/getInfo',
    method: 'get'
  })
}
